package com.lhy.framework.test.bean;

import com.lhy.framework.beans.factory.DisposableBean;
import com.lhy.framework.beans.factory.InitializingBean;

/**
 * @ClassName UserService
 * @Description
 * @Author lihaiyang
 * @Date 2022/9/8 22:01
 * @Version 1.0
 */
public class UserService implements InitializingBean, DisposableBean {

    private String userId;

    private String company;

    private String location;

    private UserDao userDao;

    public UserService() {
    }


    public void queryUserInfo() {
        System.out.println("查询用户信息：" + userDao.queryUserName(userId) + " " + company + " " + location);
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public UserDao getUserDao() {
        return userDao;
    }

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    @Override
    public void destroy() throws Exception {
        System.out.println("执行：UserService.destroy");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("执行：UserService.afterPropertiesSet");
    }
}
